
<link href="../css/Quantricss.css" rel="stylesheet" type="text/css">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>

 <?php 
        error_reporting(FALSE);
	require_once("../mysql.php");
        require_once("function_quantri.php");
	
	if(isset($_POST['btnThem']))
	{
              $idSP = $_POST['idSP'];
		$tinhnangnoibac = $_POST['tinh_nang_noi_bat'];
		$mayanh = $_POST['may_anh'];
		$dactinhmayanh = $_POST['dac_tinh_may_anh'];
		$mayanhphu = $_POST['may_phu_anh'];
		$videocall = $_POST['video_call'];
		$quayphim = $_POST['quay_phim'];
		$xemphim = $_POST['xem_phim'];
		$nghenhac = $_POST['nghe_nhac'];
		$fmradio = $_POST['fm_radio'];
		$xemtivi = $_POST['xem_tivi'];
		$ghiam = $_POST['ghi_am'];
		$ghiamcuocgoi = $_POST['ghi_am_cuoc_goi'];
		$ghiamfm = $_POST['ghi_am_fm'];
		$java = $_POST['java'];
		$trochoi = $_POST['tro_choi'];
		$ketnoitv = $_POST['ket_noi_tv'];
		$ungdungvanphong = $_POST['ung_dung_van_phong'];
		$ungdungkhac = $_POST['ung_dung_khac'];
		$nhacchuongloai =$_POST['nhachuong_loai'];
		$nhacchuongloangoai = $_POST['nhacchuong_loa_ngoai'];
		$nhacchuongbaorung = $_POST['nhacchuong_bao_rung'];
		$nhacchuongjacktainghe  =$_POST['nhacchuong_jack_tainghe'];
		$bonhotrong =$_POST['bonho_bo_nho_trong'];
		$bonhoram	=$_POST['bonho_ram'];
		$bonhovixuly = $_POST['bonho_vi_xu_ly_cpu'];
		$bonhothenhongoai = $_POST['bonho_the_nho_ngoai'];
		$bonhotoida = $_POST['bonho_ho_tro_the_toi_da'];
		$tinnhan = $_POST['tin_nhan'];
		
		//sql
   /*         mysql_query("INSERT INTO sanpham_thuoctinh VALUES(null,$idSP,$tinhnangnoibac,$mayanh,
                         $dactinhmayanh,$mayanhphu,$videocall,$quayphim,$xemphim,$nghenhac,$fmradio,
                         $xemtivi,$ghiam,$ghiamcuocgoi,$ghiamfm,$java,$trochoi,$ketnoitv,$ungdungvanphong,
                             $ungdungkhac,$nhacchuongloai,$nhacchuongloangoai,$nhacchuongbaorung,$nhacchuongjacktainghe,
                                 $bonhotrong,$bonhoram,$bonhovixuly,$bonhothenhongoai,$bonhotoida,$tinnhan)");
*/
                mysql_query("UPDATE sanpham_thuoctinh SET tinh_nang_noi_bac= $tinhnangnoibac,may_anh=$mayanh,
                         dac_tinh_may_anh=$dactinhmayanh,may_phu_anh=$mayanhphu,video_call=$videocall,quay_phim=$quayphim,xem_phim=$xemphim,nghe_nhac=$nghenhac,fm_radio=$fmradio,
                         xem_tv=$xemtivi,ghi_am=$ghiam,ghi_am_cuoc_goi=$ghiamcuocgoi,ghi_am_fm=$ghiamfm,java=$java,tro_choi=$trochoi,ket_noi_tv=$ketnoitv,ung_dung_van_phong=$ungdungvanphong,
                          ung_dung_khac= $ungdungkhac,nhacchuong_loai=$nhacchuongloai,nhacchuong_loa_ngoai=$nhacchuongloangoai,nhacchuong_bao_rung=$nhacchuongbaorung,nhacchuong_jack_tai_nghe=$nhacchuongjacktainghe,
                          bonho_bo_nho_trong=$bonhotrong,bonho_ram=$bonhoram,bonho_vi_xu_ly_cpu=$bonhovixuly,bonho_the_nho_ngoai=$bonhothenhongoai,bonho_ho_tro_the_toi_da=$bonhotoida,tin_nhan=$tinnhan)");
            header("location:Sanpham_thuoctinh.php");
          
        }
  //      if(isset($_GET['idSP']))
            $idSP = $_GET['idSP'];
        $thuoctinh = ChitietThuocTinh($idSP);
        $chitietthuoctinh = mysql_fetch_array($thuoctinh);
            
        
 ?>
 <a href="admintrangchu/index.php"><img src="admintrangchu/images/home.png">

<form action="">
<table border="1">
    <tr bgcolor="#0000FF">
        <td colspan="3" align="center"><span class="style1">Thuộc tính sản phẩm</td>
         
    </tr>
   
    
    <tr>
        <td><span class="style2">Tính năng nổi bật</span></td>
        <td colspan="2"><textarea><?php echo $chitietthuoctinh['tinh_nang_noi_bat']?></textarea></td>
    </tr>
    <tr>
        <td><span class="style2">Âm thanh</span></td>
        <td>
            <input type="checkbox" name="amthanh" value="audio" checked="checked">Audio<br/>
            <input type="checkbox" name="amthanh" value="video" <?php if($chitietthuoctinh['xem_phim']!='Không') echo "checked = 'checked'"?>>Video<br/>
            <input type="checkbox" name="amthanh" value="loaichuong" <?php if($chitietthuoctinh['nhacchuong_loa_ngoai']==1||$chitietthuoctinh['nhacchuong_bao_rung']==1) echo "checked='checked'"?>>Kiểu chuông<br/>
            <input type="checkbox" name="amthanh" value="jack" <?php if($chitietthuoctinh['nhacchuong_jack_tai_nghe']=='3.5 mm') echo "checked='checked'"?>>Jack<br/>
        </td>
        <td>
            <input type="text" name="amthanh" value="<?php echo $chitietthuoctinh['nhacchuong_loai']?>"><br/>
            <input type="text" name="amthanh" value="<?php echo $chitietthuoctinh['xem_phim']?>"><br/>
            <input type="checkbox" name="amthanh" value="loangoai" <?php if($chitietthuoctinh['nhacchuong_loa_ngoai']==1) echo "checked='checked'"?>>Loa ngoài
			<input type="checkbox" name="amthanh" value="rung" <?php if($chitietthuoctinh['nhacchuong_bao_rung']==1) echo "checked='checked'"?>>Rung <br/>		
            <input type="text" name="amthanh" value="<?php echo $chitietthuoctinh['nhacchuong_jack_tai_nghe']?>"><br/>
        </td>    
    </tr>    
    <tr>
        <td><span class="style2">Giải trí</span></td>
         <td>
            <input type="checkbox" name="mayanh" value="mayanh" <?php if($chitietthuoctinh['may_anh']!='-') echo "checked='checked'"?>/>Máy ảnh<br/>
            <input type="checkbox" name="mayanh" value="dactinhmayanh"<?php if($chitietthuoctinh['dac_tinh_may_anh']!='-') echo "checked='checked'"?>/>Đặc tính máy ảnh<br/>
            <input type="checkbox" name="mayanh" value="mayphuanh" <?php if($chitietthuoctinh['may_phu_anh']==1) echo "checked='checked'"?>/>Máy ảnh phụ<br/>
            <input type="checkbox" name="mayanh" value="videocall" <?php if($chitietthuoctinh['video_call']==1) echo "checked='checked'"?>/>Video Call<br/>
            <input type="checkbox" name="mayanh" value="quayphim" <?php if($chitietthuoctinh['quay_phim']==1) echo "checked='checked'"?>/>Quay phim<br/>
            <input type="checkbox" name="mayanh" value="ximphim" <?php if($chitietthuoctinh['xem_phim']!='Không') echo "checked = 'checked'"?>/>Xem phim<br/>
            <input type="checkbox" name="mayanh" value="fmradio" <?php if($chitietthuoctinh['quay_phim']==1) echo "checked='checked'"?>/>FM Radio<br/>
            <input type="checkbox" name="mayanh" value="xemtivi" <?php if($chitietthuoctinh['xem_phim']!='Không') echo "checked='checked'"?>/>Xem TV<br/>
        </td>
        <td>
            <input type="text" name="mayanh"  height="200" value="<?php if($chitietthuoctinh['may_anh']=='-') echo "Không"; else echo $chitietthuoctinh['may_anh']?>"/><br/>
            <input type="text" name="mayanh"  height="200" value="<?php if($chitietthuoctinh['dac_tinh_may_anh']=='-') echo "Không"; else echo $chitietthuoctinh['dac_tinh_may_anh']?>"/><br/>
            <input type="text" name="mayanh"  height="200" value="<?php if($chitietthuoctinh['may_phu_anh']==0) echo "Không"; else echo "Có"?>"/><br/>
            <input type="text" name="mayanh"  height="200" value="<?php if($chitietthuoctinh['video_call']==0) echo "Không"; else echo "Có"?>"/><br/>
            <input type="text" name="mayanh"  height="200" value="<?php if($chitietthuoctinh['video_call']==0) echo "Không"; else echo "Có"?>"/><br/>
            <input type="text" name="mayanh"  height="200" value="<?php echo $chitietthuoctinh['xem_phim']?>"/><br/>
            <input type="text" name="mayanh"  height="200" value="<?php if($chitietthuoctinh['video_call']==0) echo "Không"; else echo "Có"?>"/><br/>
            <input type="text" name="mayanh"  height="200" value="<?php echo $chitietthuoctinh['xem_phim']?>"/><br/>
        </td>    
            
    </tr>
    <tr>
        <td><span class="style2">Bộ nhớ</span></td>
        <td>
             <input type="checkbox" name="bonho" value="bonhotrong" <?php if($chitietthuoctinh['bonho_bo_nho_trong']!='Không') echo "checked='checked'"?> />Bộ nhớ trong<br/>
             <input type="checkbox" name="bonho" value="bonhongoai"<?php if($chitietthuoctinh['bonho_bo_nho_trong']!='-') echo "checked='checked'" ?>/>Bộ nhớ ngoài<br/>
             <input type="checkbox" name="bonho" value="RAM"<?php if($chitietthuoctinh['bonho_ram']!='-') echo "checked='checked'" ?>/>RAM<br/>
             <input type="checkbox" name="bonho" value="CPU"<?php if($chitietthuoctinh['bonho_vi_xu_ly_cpu']!='-') echo "checked='checked'" ?>/>CPU<br/>
             <input type="checkbox" name="bonho" value="hotrotoida" <?php if($chitietthuoctinh['bonho_ho_tro_the_toi_da']!='-') echo "checked='checked'" ?>/>Hỗ trợ tối đa<br/>
        </td>
        <td>
            <input type="text" name="bonho"  height="200" value="<?php echo $chitietthuoctinh['bonho_bo_nho_trong']?>"/><br/>
            <input type="text" name="bonho"  height="200" value="<?php if($chitietthuoctinh['bonho_the_nho_ngoai']=='-') echo "Không"; else echo $chitietthuoctinh['bonho_the_nho_ngoai']?>"/><br/>
            <input type="text" name="bonho"  height="200" value="<?php if($chitietthuoctinh['bonho_ram']=='-') echo "Không"; else echo $chitietthuoctinh['bonho_ram']?>"/><br/>
            <input type="text" name="bonho"  height="200" value="<?php if($chitietthuoctinh['bonho_xi_xu_ly_cpu']=='-') echo "Không"; else echo $chitietthuoctinh['bonho_vi_xu_ly_cpu']?>"/><br/>
            <input type="text" name="bonho"  height="200" value="<?php if($chitietthuoctinh['bonho_ho_tro_the_toi_da']=='-') echo "Không"; else echo $chitietthuoctinh['bonho_ho_tro_the_toi_da']?>"/><br/>
        </td>
    </tr>    
    <tr>
         <td><span class="style2">Ứng dụng và trò chơi</span></td>
        <td>
             <input type="checkbox" name="app&game" value="ghiam"  <?php if($chitietthuoctinh['ghi_am']==1) echo "checked='checked'"?> />Ghi âm<br/>
             <input type="checkbox" name="app&game" value="ghiamcuocgoi" <?php if($chitietthuoctinh['ghi_am_cuoc_goi']==1) echo "checked='checked'"?> />Ghi âm cuộc gọi<br/>
             <input type="checkbox" name="app&game" value="ghiamfm" <?php if($chitietthuoctinh['ghi_am_fm']==1) echo "checked='checked'"?> />Ghi âm FM<br/>
             <input type="checkbox" name="app&game" value="java" <?php if($chitietthuoctinh['java']==1) echo "checked='checked'"?> />Java<br/>
             <input type="checkbox" name="app&game" value="trochoi" value="checked='checked'"/>Trò chơi<br/>
             <input type="checkbox" name="app&game" value="ketnoitv" <?php if($chitietthuoctinh['ket_noi_tv']==1) echo "checked='checked'"?> />Kết nối TV<br/>
             
        </td>
        <td>
            <input type="text" name="app&game"  height="200" value="<?php if($chitietthuoctinh['ghi_am']==0) echo "Không"; else echo "Có"?>"/><br/>
            <input type="text" name="app&game"  height="200" value="<?php if($chitietthuoctinh['ghi_am_cuoc_goi']==0) echo "Không"; else echo "Có"?>"/><br/>
            <input type="text" name="app&game"  height="200" value="<?php if($chitietthuoctinh['ghi_am_fm']==0) echo "Không"; else echo "Có"?>"/><br/>
            <input type="text" name="app&game"  height="200" value="<?php if($chitietthuoctinh['java']==0) echo "Không"; else echo "Có"?>"/><br/>
            <input type="text" name="app&game"  height="200" value="<?php echo $chitietthuoctinh['tro_choi']?>"/><br/>
            <input type="text" name="app&game"  height="200" value="<?php if($chitietthuoctinh['ket_noi_tv']==0) echo "Không"; else echo "Có"?>"/><br/>
        </td>
    </tr>
    
      <tr>
         <td><span class="style2">Ứng dụng văn phòng</span></td>
        <td colspan="2">
            <textarea><?php echo $chitietthuoctinh['ung_dung_van_phong']?></textarea>
             
        </td>
        
    </tr>
    <tr>
         <td><span class="style2">SMS</span></td>
         <td colspan="2">
            <textarea><?php echo $chitietthuoctinh['tin_nhan']?></textarea>
        </td>
        
    </tr>
    <tr>
         <td><span class="style2">Ứng dụng khác</span></td>
         <td colspan="2"> 
            <textarea><?php echo $chitietthuoctinh['ung_dung_khac']?></textarea>
        </td>
        
    </tr>
    <tr>
		<td colspan="3" align="center">
			<label>
				<input type="submit" name="btnThem" id="btnThem" value="Thêm" />
			</label>
		</td>
	</tr>	
	
 </table>  
</form>
           
             

